<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script type="text/javascript">
    var money = 0;
    while (true) {
        var num = prompt("请输入您需要的操作：\n" + "1、存钱\n" + "2、取钱\n" + "3、显示余额\n" + "4、退出", "");
        if (num == 1) {
            var mn = prompt("请输入金额：", "");
            if (isNaN(mn)) {
                alert("请输入正确的金额！")
            } else {
                money = money + parseFloat(mn)
                continue;
            }
        }
        if (num == 2) {
            var qmn = prompt("请输入金额：", "");
            if (qmn > money) {
                alert("余额不够！")
            } else {
                if (isNaN(qmn)) {
                    alert("请输入正确的金额！")
                } else {
                    money = money - parseFloat(qmn)
                }
                continue;
            }
        }
        if (num == 3) {
            var y = prompt("余额：", money);
            continue;
        } else {
            break;
        }
    }
</script>
</html>